/*
 * Created by JFormDesigner on Mon Mar 20 21:10:41 CST 2023
 */

package com.viking.gui.experiment;

import com.viking.gui.datechooser.JDateChooser;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle;
import javax.swing.table.*;

/**
 * @author 29046
 */
public class Experiment extends JFrame {
    public Experiment() {
        initComponents();
    }
    /** 实验时间单击监听器*/
    private void experimentTimetextField5MouseClicked(MouseEvent e) {
        JDateChooser gg = new JDateChooser();
        gg.showDateChooser();
        experimentTimetextField5.setText(gg.getDateFormat("yyyy-MM-dd"));
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        experimentNamelabel1 = new JLabel();
        experimentNametextField1 = new JTextField();
        experimentNumberlabel2 = new JLabel();
        experimentTimelabel3 = new JLabel();
        experimentEquipmentlabel4 = new JLabel();
        inquirebutton1 = new JButton();
        resetbutton2 = new JButton();
        scrollPane1 = new JScrollPane();
        table1 = new JTable();
        dlabel10 = new JLabel();
        comboBox1 = new JComboBox<>();
        pagelabel11 = new JLabel();
        addbutton3 = new JButton();
        changebutton4 = new JButton();
        deletebutton5 = new JButton();
        experimentNumbertextField2 = new JTextField();
        experimentTimetextField5 = new JTextField();
        experimentEquipmenttextField3 = new JTextField();

        //======== this ========
        setResizable(false);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("\u5b9e\u9a8c");
        Container contentPane = getContentPane();

        //---- experimentNamelabel1 ----
        experimentNamelabel1.setText("\u5b9e\u9a8c\u540d\u79f0\uff1a");

        //---- experimentNumberlabel2 ----
        experimentNumberlabel2.setText("\u5b9e\u9a8c\u7f16\u53f7\uff1a");

        //---- experimentTimelabel3 ----
        experimentTimelabel3.setText("\u5b9e\u9a8c\u65f6\u95f4\uff1a");

        //---- experimentEquipmentlabel4 ----
        experimentEquipmentlabel4.setText("\u5b9e\u9a8c\u8bbe\u5907\uff1a");

        //---- inquirebutton1 ----
        inquirebutton1.setText("\u67e5\u8be2");

        //---- resetbutton2 ----
        resetbutton2.setText("\u91cd\u7f6e");

        //======== scrollPane1 ========
        {

            //---- table1 ----
            table1.setModel(new DefaultTableModel(
                new Object[][] {
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null},
                    {null, null, null, null},
                },
                new String[] {
                    "\u5b9e\u9a8c\u540d\u79f0", "\u5b9e\u9a8c\u7f16\u53f7", "\u5b9e\u9a8c\u65f6\u95f4", "\u5b9e\u9a8c\u8bbe\u5907"
                }
            ));
            scrollPane1.setViewportView(table1);
        }

        //---- dlabel10 ----
        dlabel10.setText("\u7b2c");

        //---- comboBox1 ----
        comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
            "1",
            "2",
            "3",
            "4",
            "5",
            "6"
        }));

        //---- pagelabel11 ----
        pagelabel11.setText("\u9875");

        //---- addbutton3 ----
        addbutton3.setText("\u589e\u52a0");

        //---- changebutton4 ----
        changebutton4.setText("\u4fee\u6539");

        //---- deletebutton5 ----
        deletebutton5.setText("\u5220\u9664");

        //---- experimentTimetextField5 ----
        experimentTimetextField5.setEditable(false);
        experimentTimetextField5.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                experimentTimetextField5MouseClicked(e);
            }
        });

        GroupLayout contentPaneLayout = new GroupLayout(contentPane);
        contentPane.setLayout(contentPaneLayout);
        contentPaneLayout.setHorizontalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGap(22, 22, 22)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                        .addGroup(contentPaneLayout.createSequentialGroup()
                            .addGap(12, 12, 12)
                            .addComponent(dlabel10)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(pagelabel11, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
                            .addGap(286, 286, 286)
                            .addComponent(addbutton3)
                            .addGap(28, 28, 28)
                            .addComponent(changebutton4)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(deletebutton5))
                        .addComponent(scrollPane1)
                        .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
                            .addGroup(contentPaneLayout.createParallelGroup()
                                .addGroup(contentPaneLayout.createSequentialGroup()
                                    .addComponent(experimentNumberlabel2)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(experimentNumbertextField2, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE))
                                .addGroup(contentPaneLayout.createSequentialGroup()
                                    .addComponent(experimentNamelabel1)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(experimentNametextField1, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)))
                            .addGap(61, 61, 61)
                            .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                                .addComponent(experimentTimelabel3)
                                .addComponent(experimentEquipmentlabel4))
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(contentPaneLayout.createParallelGroup()
                                .addComponent(experimentTimetextField5, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)
                                .addComponent(experimentEquipmenttextField3, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE))
                            .addGap(123, 123, 123)
                            .addGroup(contentPaneLayout.createParallelGroup()
                                .addComponent(inquirebutton1)
                                .addComponent(resetbutton2))))
                    .addContainerGap(37, Short.MAX_VALUE))
        );
        contentPaneLayout.setVerticalGroup(
            contentPaneLayout.createParallelGroup()
                .addGroup(contentPaneLayout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(experimentNumberlabel2)
                        .addComponent(experimentNumbertextField2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(experimentTimelabel3)
                        .addComponent(experimentTimetextField5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(inquirebutton1))
                    .addGap(30, 30, 30)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(experimentNamelabel1)
                        .addComponent(experimentNametextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(experimentEquipmentlabel4)
                        .addComponent(experimentEquipmenttextField3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(resetbutton2))
                    .addGap(49, 49, 49)
                    .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 135, GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(addbutton3)
                        .addComponent(deletebutton5)
                        .addComponent(changebutton4)
                        .addComponent(dlabel10)
                        .addComponent(pagelabel11, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(27, Short.MAX_VALUE))
        );
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel experimentNamelabel1;
    private JTextField experimentNametextField1;
    private JLabel experimentNumberlabel2;
    private JLabel experimentTimelabel3;
    private JLabel experimentEquipmentlabel4;
    private JButton inquirebutton1;
    private JButton resetbutton2;
    private JScrollPane scrollPane1;
    private JTable table1;
    private JLabel dlabel10;
    private JComboBox<String> comboBox1;
    private JLabel pagelabel11;
    private JButton addbutton3;
    private JButton changebutton4;
    private JButton deletebutton5;
    private JTextField experimentNumbertextField2;
    private JTextField experimentTimetextField5;
    private JTextField experimentEquipmenttextField3;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
